<template>
	<view>
		<uni-grid :column="2" :show-border="false" @change="change" >
			<uni-grid-item v-for="(item, index) in data"  :key="index" :index="item.lidd">
				<view class="grid-item-box" style="background-color: #fff;">
					<image :src="$base + item.pic" mode="widthFix"></image>
					<text class="text">¥：{{item.price}}</text>
				</view>
			</uni-grid-item>
		</uni-grid>
	</view>
</template>

<script>
	import {footercha} from '@/service/index.js'
	export default {
		data() {
			return {
            data:''
			}
		},
		methods: {
           change(e){
			   console.log(e.detail.index)
			   uni.navigateTo({
			   	url:'/pages/productDetails/productDetails?lid='+e.detail.index
			   })
		   }
		},
	async	onLoad() {
			let  res=await footercha(this.$uid)
			this.data=res.result
			console.log(res.result)
		}
		
	}
</script>

<style>
	image {
		width: 300rpx;
		margin: 0 auto;
		display: block;
	}

	text {
		display: block;
		text-align: center;
	}
</style>
